Skip to main content

translateX

Type​

property

Summary​

Sets the horizontal translation of an object by moving it along the X-axis

Syntax​

set the translateX of object to <number>[%]

Description​

Use the translateX property to move an object horizontally in pixels or as a percentage of its width. This property can only be set, getting the value will return empty.

When set, it moves the object by updating its left position relative to the current position.

Examples​

# Move 100 pixels right
set the translateX of btn "MyButton" to 100
# Move right by half the object's width
set the translateX of btn "MyButton" to "50%"

Value​

NameTypeDescription

value

The distance to translate the object horizontally. Can be:

  • A number (in pixels)
  • A percentage (e.g., "50%") relative to the object's width

Compatibility and Support​

OS

mac

windows

linux

ios

android

Platforms

desktop

mobile

web